﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestYijie : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        YijieProxy.Instance.Init();
    }

    // Update is called once per frame
    void Update()
    {

    }

    private void OnLogin(bool result, string param)
    {
        Debug.Log("OnLogin result:" + result);
        Debug.Log("100Gold 0");
        YijieProxy.Instance.Charge("超级无敌大钻石100个", 100, OnCharge);
    }

    private void OnLogOut(bool result, string param)
    {
        Debug.Log("OnLogOut result:" + result);
    }

    private void OnCharge(bool result, string param)
    {
        Debug.Log("OnCharge result:" + result + " " + param);
    }

    public void OnGUI()
    {
        //for test
        if (GUI.Button(new Rect(10, 30, 100, 60), "Login"))
        {
            Debug.Log("login 0");
            YijieProxy.Instance.Login(OnLogin);
        }
        if (GUI.Button(new Rect(150, 30, 100, 60), "Logout"))
        {
            Debug.Log("Logout 0");
            YijieProxy.Instance.LogOut(OnLogOut);
        }
        if (GUI.Button(new Rect(10, 110, 100, 60), "100Gold"))
        {
            Debug.Log("100Gold 0");
            YijieProxy.Instance.Charge("超级无敌大钻石100个", 100, OnCharge);
        }
    }
}
